import {createStore} from 'redux';
import {persistReducer, persistStore} from 'redux-persist';
import AsyncStorage from '@react-native-community/async-storage';

import reducers from './reducers';

const persistCfg = {
    key: 'paringapp',
    storage: AsyncStorage,
};
const persistReducers = persistReducer(persistCfg, reducers);

const store = createStore(persistReducers);
export default store;

export const persistor = persistStore(store);
